using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Xml;
using GwtRpcNet.Service;

namespace GwtRpcNet.Configuration
{
    public class GwtRpcNetSectionHandler : IConfigurationSectionHandler
    {
        public object Create(object parent, object configContext, XmlNode section)
        {
            GwtRpcNetServiceInfo info;
            try
            {
                info.LibraryName = section.Attributes["libraryName"].Value;
                return info;
            }
            catch (Exception ex)
            {
                string message = "Incorrect configuration for GwtRpcNetService";
                throw new ConfigurationException(message, ex, section);
            }
        }
    }
}
